export function getTopItems(dictId) {
  return RSocket.rs({
    route: `dicts.${dictId}.items.top`,
  });
}

export function getChildren(dictId, parentId) {
  return RSocket.rs({
    route: `dicts.${dictId}.items.${parentId}`,
  });
}

export function itemsByLevel(dictId, maxLevel) {
  return RSocket.rs({
    route: `dicts.${dictId}.items`,
    args: {
      search: { fullId: `^[^:]*(:[^:]+){0,${maxLevel - 1}}$` },
      pg: { page: 0, size: 1000000, sort: ['itemId;asc'] },
    },
  });
}



export function getItems(dictId) {
  return RSocket.rs({
    route: `dicts.${dictId}.items`,
  });
}
